package pe.com.bn.sach.dao.impl;

import java.util.List;
import com.ibatis.sqlmap.client.SqlMapClient;
import pe.com.bn.sach.domain.Bnchf53CalAprobSectFinanc;
import pe.com.bn.sach.dao.AprobSectorFinan53DAO;

import org.apache.log4j.Logger;
 
public class AprobSectorFinan53Impl  implements AprobSectorFinan53DAO
{
 
	private static Logger depurador = Logger.getLogger(AprobSectorFinan53Impl.class.getName());
	protected SqlMapClient sqlMap = null;
	
	public void setSqlMap(SqlMapClient sqlMap) {
		this.sqlMap = sqlMap;
	}
	

	public int GuardaAprobSectorFinan(Bnchf53CalAprobSectFinanc bnchf53CalAprobSectFinanc) 
				throws Exception{	
				int r =0;
    		try{
    			sqlMap.startTransaction();
    			sqlMap.insert("sqlAprobSectorFinan53.GuardaAprobSectorFinanciero",bnchf53CalAprobSectFinanc);
    			sqlMap.commitTransaction();
    			r=1;
    		} catch (Exception e) {
    			e.printStackTrace();
    			throw e;
    		 } finally {
    		    sqlMap.endTransaction();
    		}
    	 return r;
    }
	
	public void ActualizaAprobSectorFinan(Bnchf53CalAprobSectFinanc bnchf53CalAprobSectFinanc) 
	throws Exception{
	      try {
        	sqlMap.startTransaction();
            sqlMap.update("sqlAprobSectorFinan53.ActualizaAprobSectorFinanciero",bnchf53CalAprobSectFinanc);
            sqlMap.commitTransaction();
            
        } catch (Exception e) {
			e.printStackTrace();
			throw e;
		 } finally {
		    sqlMap.endTransaction();
		}
        
    }
	
	public List ListaAprobSectorFinan(Bnchf53CalAprobSectFinanc bnchf53CalAprobSectFinanc) throws Exception{
		return sqlMap.queryForList("sqlAprobSectorFinan53.listaAprobSectorFinanciero",bnchf53CalAprobSectFinanc);
	}
	
	
	
	
}
